﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:ICSharpCode.AvalonEdit.AddIn"
	xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
	xmlns:core="http://icsharpcode.net/sharpdevelop/core"
>
	<Style TargetType="{x:Type local:SharpDevelopTextEditor}">
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:SharpDevelopTextEditor}">
					<widgets:ZoomScrollViewer
						Focusable="False"
						Name="PART_ScrollViewer"
						MouseWheelZoom="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Options.MouseWheelZoom}"
						CanContentScroll="True"
						VerticalScrollBarVisibility="Visible"
						HorizontalScrollBarVisibility="Visible"
						Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TextArea}"
						VerticalContentAlignment="Top"
						HorizontalContentAlignment="Left"
						Background="{TemplateBinding Background}"
						Padding="{TemplateBinding Padding}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						TextOptions.TextFormattingMode="{Binding CurrentZoom, ElementName=PART_ScrollViewer, Converter={x:Static local:ZoomLevelToTextFormattingModeConverter.Instance}}" />
					<ControlTemplate.Triggers>
						<Trigger Property="WordWrap"
						         Value="True">
							<Setter TargetName="PART_ScrollViewer"
							        Property="HorizontalScrollBarVisibility"
							        Value="Disabled" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>